package com.ycfmedical.bed.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.TextView;

import com.ycfmedical.bed.R;
import com.ycfmedical.bed.local.entity.PhysicianChargeMsg;

import butterknife.BindView;
import cn.droidlover.xdroidmvp.base.SimpleRecAdapter;
import cn.droidlover.xdroidmvp.kit.KnifeKit;

/**
 * Created by yf on 2017-03-27.
 */

public class PhysicianChargeAdapter extends SimpleRecAdapter<PhysicianChargeMsg, PhysicianChargeAdapter.ViewHolder> {




    public PhysicianChargeAdapter(Context context) {
        super(context);
    }

    @Override
    public ViewHolder newViewHolder(View itemView) {
        return new ViewHolder(itemView);
    }

    @Override
    public int getLayoutId() {
        return R.layout.adapter_physician_item;
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
        PhysicianChargeMsg physicianChargeMsg = data.get(position);
        holder.itemNumber.setText(position + 1 + " ");
        holder.physicianContent.setText(physicianChargeMsg.getPhysicianContent());
        holder.physicianDate.setText(physicianChargeMsg.getPhysicianDate());
        holder.physicianType.setText(physicianChargeMsg.getPhysicianType());
    }


    public static class ViewHolder extends RecyclerView.ViewHolder {
        @BindView(R.id.itemNumber)
        TextView itemNumber;
        @BindView(R.id.physicianDate)
        TextView physicianDate;
        @BindView(R.id.physicianContent)
        TextView physicianContent;

        @BindView(R.id.physicianType)
        TextView physicianType;

        public ViewHolder(View itemView) {
            super(itemView);
            KnifeKit.bind(this, itemView);
        }
    }
}
